package com.nbgs.demo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nbgs.demo.controller.form.UserNews;
import com.nbgs.demo.dao.UserMapper;
import com.nbgs.demo.model.User;
import com.nbgs.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public void addUser(User user) {
    userMapper.addUser(user);
    }

    @Override
    public int findUserIdByIDNum(String IDNum) {
        return userMapper.findUserIdByIDNum(IDNum);
    }

    @Override
    public IPage<UserNews> showSumUserNews(Page<UserNews> page, String areaName, String type, String meterState,String cardNum) {
        return userMapper.showSumUserNews(page, areaName, type, meterState,cardNum);
    }

    @Override
    public int getTotalUserNews(String areaName, String type, String meterState,String cardNum) {
        return userMapper.getTotalUserNews(areaName, type, meterState,cardNum);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }
}
